<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets">
    
    <h:head>
        <title>Update Password</title>
    </h:head>
    <f:view>
    <body>
        
                <ui:composition	template="../includes/template.xhtml">
        
             <ui:define name="mainbody">
                    <center>

                    <h:form>               
                        
                        <p:panel header="Update Password" style="min-height: 550px" styleClass="prime_panel">
                        <p:growl id="growl" showDetail="true" sticky="false"  autoUpdate="true"  showSummary="false" />
                            <p:spacer width="10"/>
                            <center>
                                <table cellpadding="4px" cellspacing="8px">

                                    <tr>
                                        <td><h:outputText value="Parent or Teacher:" /><h:outputText value="*" style="color:red"/></td>
                                        <td>
										<p:autoComplete
											style="width:250"  maxResults="5"
										 	value="#{updatePasswordBean.selectedUser}" id="user"
											completeMethod="#{updatePasswordBean.completeUser}" 
											var="s" itemLabel="#{s.name} #{s.email}" itemValue="#{s}"
											converter="#{updatePasswordBean.userConverter}"
											title="Enter a letter and names will appear"
											forceSelection="true"  required="true" requiredMessage="Please Select required user"
											/>
										</td>
                                    </tr>
                                    <tr>
                                        <td><h:outputText value="Password :" /><h:outputText value="*" style="color:red"/></td>
                                        <td>                          
                                            <p:password feedback="true"  match="password2" required="true" validatorMessage="Passwords should match" requiredMessage="Please enter Password" id="password" value="#{updatePasswordBean.selectedUser.password}"/>
                                        </td>
                                    </tr>

                                    <tr>
                                        <td><h:outputText value="Re-Enter Password :" /><h:outputText value="*" style="color:red"/></td>
                                        <td>
                                            
                                            <p:password feedback="false" id="password2" required="true" requiredMessage="Please enter Password"/>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td style="text-align: right">
                                            <p:commandButton id="submit" value="Done" type="submit" ajax="false" action="#{updatePasswordBean.updatePassword}" /> 
                                        </td>
                                    </tr>
                                </table>
                            </center>
                        </p:panel>
                   </h:form>
            </center>
          </ui:define>                    
    </ui:composition>
    </body>
    </f:view>
</html>
